import "./assets/main.css";
import "element-plus/dist/index.css";
import "./assets/styles/theme.css";

import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import pinia from "./store";
import { useThemeStore } from "./store";

// 创建应用实例
const app = createApp(App);

// 使用插件
app.use(router);
app.use(ElementPlus, {
  // 配置Element Plus主题
  zIndex: 3000,
});
app.use(pinia);

// 初始化主题
const themeStore = useThemeStore();
themeStore.initTheme();

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 挂载应用
app.mount("#app");
